﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>partial application - currying</title>
    <script type="text/javascript" src="../common/commonFuncs.js">
    </script>
    <script type="text/javascript">
        function testBind() {
            var sum = function (x, y) { return x + y; };
            var succ = sum.bind(null, 1);
            printline(succ(2));

            function f(y, z) {
                return this.x + y + z;
            };

            var g = f.bind({ x: 1 }, 2);
            printline(g(3));
        }
    </script>
    <style type="text/css">
        .block
        {
            background-color: wheat;
            color: crimson;
            margin: 10px;
        }
        
        .note
        {
            color: navy;
            border: 1px navy dashed;
            margin: 0px;
        }
    </style>
</head>
<body>
    <div class="block">
        <script type="text/javascript">            testBind();</script>
    </div>
</body>
</html>
